Skip to content

fix(id): validate [interfaces.web] route/socket before axum registration panics (#4779) - #4781

Merged
dezren39 merged 1 commit into
mainfrom
queue/6787-4779-web-route-validation
Nov 3, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6787-4779-web-route-validation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #4779. Does not touch #4060 scope (parse_app_manifest/discover_apps).

Problem

web_interface_from_app_toml (pkgs/id/src/web/app_interface.rs) validated only the [interfaces.web] mode, so route/socket strings flowed unchecked into create_router_for_app, where axum panics on a path without a leading slash or on a path colliding with an already-registered host route. Verified pre-fix: route='arena', route='/', route='/files', socket='ws/arena', socket='/ws/tags' each parsed Ok and panicked (routes.rs:322, routes.rs:382, world_ws.rs:60); web files unchanged since the probe base (cb190a3..a41cba3 empty diff).

Fix

Parse-time validation with named WebInterfaceError variants:

  • RouteMustStartWithSlash / SocketMustStartWithSlash — value must start with '/'
  • RouteSocketOverlap — both sides naming the same path
  • RouteReserved / SocketReserved — collision with a host-registered route (HOST_RESERVED_ROUTES, mirrored with create_router_inner + world_http_routes, plus the /api/world/* prefix)

Applies to all modes uniformly; the world app binding (/world + /ws/world) and tic-tac-toe (/tic-tac-toe) still parse.

Tests

cargo test --lib --features web -- app_interface public_entry_point: 13/13 pass — 7 new regression tests (five panic cases + overlap + world-binding control) and the existing public_entry_point_honours_a_configured_binding router test stays green.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…ion panics (#4779)

web_interface_from_app_toml now rejects route/socket values missing a
leading slash, both sides naming the same path, and either side
colliding with a host-registered route, with named WebInterfaceError
variants instead of a router-construction panic. Adds regression tests
for the five verified panic cases plus the valid control.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 07:16
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T07:16:54.096598Z
We couldn’t complete this review. Comment @codex review to try again.
b4c5177 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 600d4ee3-25bc-49db-a376-2e43b29849b7
Commits

Reviewing files that changed from the base of the PR and between a41cba3 and b4c5177.

Files selected for processing: 1
  • pkgs/id/src/web/app_interface.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id(web): web_interface_from_app_toml accepts route/socket values that panic in create_router_for_app (no leading-slash or host-route collision check)

1 participant